n = float(input())

if n<5:
    y = -n + 2.5
elif n<10:
    y = 2- 1.5*(n-3)*(n-3)
else:
    y = n/2 -1.5

print(format(y,".3f"))